package com.hsgene.user.persistence;

import com.hsgene.user.condition.ShoppingMallCustomerCondition;
import com.hsgene.user.dto.user.customer.CustomerDto;
import com.hsgene.user.dto.user.customer.ShoppingMallCustomerDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 客户信息Repository
 *
 * @author wangbing
 * @version 1.0, 2018/7/6
 */
@Repository
public interface CustomerRepository {

    /**
     * 更具用户id查找用户信息
     *
     * @param userId 用户id
     * @return 用户信息
     */
    CustomerDto findCustomerById(@Param("userId") String userId);

    /**
     * 获取商城用户数量
     * @param condition 查询条件
     * @return
     */
    int count(@Param("condition") ShoppingMallCustomerCondition condition);

    /**
     * 商城用户列表
     * @param condition 查询条件
     * @return
     */
    List<ShoppingMallCustomerDto> customers(@Param("condition") ShoppingMallCustomerCondition condition);
}
